package com.example.admin.controller.web.common;

import com.example.common.core.response.AjaxResult;
import com.example.common.system.entity.UserEntity;
import com.example.security.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author chenjf
 * @Date 2022/9/20
 * @Description 登录
 */
@RestController
@RequestMapping
public class LoginController {

    @Autowired
    private LoginService loginService;

    @PostMapping("/login")
    public AjaxResult login(@RequestBody UserEntity loginUser){
        return loginService.login(loginUser);
    }

    @PostMapping("/register")
    public AjaxResult register(@RequestBody UserEntity loginUser){
        return AjaxResult.success(loginUser);
    }

}
